package com.medicalproject.demo;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AlipayConfig {

    @Bean
    public AlipayClient alipayClient() {
        return new DefaultAlipayClient(
                gatewayUrl,
                app_id,
                merchant_private_key,
                "json",
                charset,
                alipay_public_key,
                sign_type
        );
    }

    // 应用ID
    public static String app_id = "2021004199611534";

    // 应用私钥 - 使用新生成的
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCEQUL0Y3MC6/j8Jv5NzzMvDCoVgtfRQiAZKHXiSm7fq2L6iUC8+crTlFeAKeRpqWvUw0RwxxCqOlHHP5sS6938lVckdRKADAUiupaX755ZsNkaLL5QuYUC4f3Og9+50CY6wSghr5ywZemXCYpNaUWrVy78ge6NMmoCssR9vTkOECkveyvxsNgKfmhFSMlHE4cVVuSyNvrPbk9ClThvXuJ7ozsjV5d0kiCwAjaqNEgqCAtgCXrpc3FGzRe1yyUnxrAd1lq1xFUTnPyw4ttsEmzPjADgyfCUs/6RMpfmmG2XIV58/rG4WB+UxphlSRUGy3A7kSXln2BuOisWvPOfR/LlAgMBAAECggEAIQXangMm+JfLN8rUvMD72seCypQ9JzcHpMCBjttfC+JTeJNE4urMRkBICOxs6CUxk5KeSDqsYpTlTocHRZY3e5YeiC/jSq21qpJEf/OI6oRJ8Usyyh1IpQugwCwVdOQQZ6NLTf33deQ8i0YKjoG2r625Qbt/wSnRZpMUlQDmeigXX3WdjFYP/TmGMcuoPkAtdEAQp+a1D+vCBPM95dDqslfPc+uXgsuhCGnuyyfK1ve8sbdMYvo2Jdux1T76bBhfjdux5VUO5VisU4thycnuqRVr1e2kT6g0SMBakghGKnNDPyM8vm0Pld1mpB89MlX6XBJyG59tKEEGoDbOV+ZXkQKBgQDzXB6sa2MclgM2twrySyM/oe9Rf8xdgEL0kSRIwwbzQq4ZCG1SV99rBktqk4oKW1g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4wA4MnwILP+kTKX5phtIyFefP6xuFqfIMaYZUKVBstwO5EI5Z9gbjorFrzzn0fy5QIDAQAB";

    // 支付宝公钥 - 使用新的支付宝公钥
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh8dKi40dt0OurfxJsc9v92nzBKodC3W67r0vuSrM69XwRcJuiL+kVwmy5eHTJjDSGI9HJVPJe0Fvtk4xNwucLYS1P+AfIREQhB73VrXTxBOXrlDzJzOWgJcP9IQzkIRM/G+NFofTntFUmdLPoWF3LH3UwYmMuaLd8Liuj5oa6iJcZRuQsogaHFVHU2IO/bSZbmJcLSAn3Tv/5IbSDk2efHhG30S17QKoxyLRbfDdjcXjWU/ZV32ffH/W2BM3MHMYwLsO10A6w1GZCR5KkKBRJqyUGbkUHZqFT3ruT03zsgoAKAXEWxPiALoRD3cajaCp97YkyTe4yZN8tuqtDV/LKwIDAQAB";

    // 回调地址
    public static String notify_url = "\n" +
            "http://119.3.186.30:9999/api-user-service/api/alipay/callback";
    public static String return_url = "\n" +
            "http://119.3.186.30:9999/api-user-service/api/alipay/callback";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关（沙箱环境）
    public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
}